home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume9 / elm2 / part01 next >
Encoding:
Internet Message Format  |  1987-03-08  |  60.0 KB

  1. Subject:  v09i001:  ELM Mail System, Part01/19
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.TMC.COM
  4.  
  5. Submitted by: Dave Taylor <hplabs!taylor>
  6. Mod.sources: Volume 9, Issue 1
  7. Archive-name: elm2/Part01
  8.  
  9. [  Dave tells me this is probably the final release of ELM; I hope
  10.    not -- what will I use to start off Volume 10? :-)  --r$  ]
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line,
  14. # then unpack it by saving it in a file and typing "sh file".
  15. # If this archive is complete, you will see the message:
  16. #        "End of archive 1 (of 19)."
  17. # Contents:  bin doc doc/Elm.coversheet doc/answer.1 doc/autoreply.1
  18. #   doc/checkalias.1 doc/elm-help.0 doc/elm-help.1 doc/elm-help.2
  19. #   doc/elmrc.sample doc/filter.1 doc/from.1 doc/listalias.1
  20. #   doc/messages.1 doc/newalias.1 doc/newmail.1 doc/printmail.1
  21. #   doc/trim-headers.1 doc/wnewmail.1 filter filter/Makefile
  22. #   filter/Makefile.mstr hdrs hdrs/curses.h hdrs/save_opts.h src
  23. #   src/delete.c src/getopt.c src/output_utils.c src/pmalloc.c
  24. #   src/quit.c src/remail.c src/signals.c src/string2.c
  25. #   src/validname.c test test/test.empty utils utils/listalias.c
  26. #   utils/mailrc.awk utils/trim-headers
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test ! -d bin ; then
  29.     echo shar: Creating directory \"bin\"
  30.     mkdir bin
  31. fi
  32. if test ! -d doc ; then
  33.     echo shar: Creating directory \"doc\"
  34.     mkdir doc
  35. fi
  36. echo shar: Extracting \"doc/Elm.coversheet\" \(526 characters\)
  37. if test -f doc/Elm.coversheet ; then 
  38.   echo shar: Will not over-write existing file \"doc/Elm.coversheet\"
  39. else
  40. sed "s/^X//" >doc/Elm.coversheet <<'END_OF_doc/Elm.coversheet'
  41. X.PH ""
  42. X\"
  43. X\"  Cover sheet for the ELM mail system...
  44. X\"  format with 'troff -mm Elm.coversheet > Coversheet.fmtd'
  45. X\"  or something similar.
  46. X\"  (C) Copyright 1986 Dave Taylor
  47. X\"
  48. X.PF ""
  49. X.ds HF 3  3 
  50. X.ds HP 12 12
  51. X.SA 1
  52. X.nr Hy 1
  53. X.nr Pt 1
  54. X.nr Pi 8
  55. X.lg 1
  56. X.HM 1 1
  57. X.rs
  58. X.sp 11
  59. X.ce 99
  60. X.ps 25
  61. X\fBThe \s26Elm\s25 Mail System\fR
  62. X.sp 2
  63. X.ps 14
  64. X\fIA Replacement Mailer for All Unix Systems\fR
  65. X.sp 8
  66. XDave Taylor
  67. X.sp 2
  68. XHewlett-Packard Laboratories
  69. X1501 Page Mill Road
  70. XPalo Alto CA
  71. X94304
  72. X.sp 2
  73. Xemail: taylor\s12@\s14hplabs \ or \ hplabs!taylor
  74. END_OF_doc/Elm.coversheet
  75. if test 526 -ne `wc -c <doc/Elm.coversheet`; then
  76.     echo shar: \"doc/Elm.coversheet\" unpacked with wrong size!?
  77. fi
  78. # end of overwriting check
  79. fi
  80. echo shar: Extracting \"doc/answer.1\" \(1814 characters\)
  81. if test -f doc/answer.1 ; then 
  82.   echo shar: Will not over-write existing file \"doc/answer.1\"
  83. else
  84. sed "s/^X//" >doc/answer.1 <<'END_OF_doc/answer.1'
  85. X.TH ANSWER 1L 
  86. X.ad b
  87. X.SH NAME
  88. Xanswer - phone message transcription system
  89. X.SH SYNOPSIS
  90. X.B answer
  91. X.PP
  92. X.SH HP-UX COMPATIBILITY
  93. X.TP 10
  94. XLevel:
  95. XHP-UX/CONTRIBUTED
  96. X.TP
  97. XOrigin:
  98. XHewlett-Packard
  99. X.SH DESCRIPTION
  100. X.I Answer\^
  101. Xis a part of the 
  102. X.B Elm
  103. Xmail system and is designed for secretaries and the like
  104. Xto allow them to answer phones and|or listen to phone message
  105. Xmachines and quickly and easily transcribe the messages into
  106. Xelectronic mail.
  107. X.P
  108. XThe program uses it's own alias set (usually a subset of the
  109. Xsystem aliases, with more fields per user (ie unique first
  110. Xnames, unique last names, first-initial lastname, and so on)).
  111. XNote this means that you must create and then install, using
  112. X.I newalias,
  113. Xa separate alias table for the account this program is to 
  114. Xbe run from.
  115. X.P
  116. XInterface-wise, the program is a breeze to use - type 'answer'
  117. Xto start it up and then merely type a user name at the
  118. X.nf
  119. X    
  120. X    Message to:
  121. X
  122. X.fi
  123. Xprompt, and then enter the message, ending with a blank line.
  124. XNames can be entered as 'Firstname Lastname' and the system
  125. Xwill try to find a mail alias based on the first letter of the
  126. Xfirst name plus the last name.  For example, 'Dave Taylor'
  127. Xwill cause the program to search for an alias 'd_taylor' in
  128. Xthe file (note the transliteration into lower case).   The 
  129. Xprogram will loop until killed or quit.
  130. X.P
  131. X.I Answer
  132. Xcan be easily exited by typing any of 'quit', 'exit' 'done', 
  133. Xor 'bye' at the 'Message to:' prompt.
  134. X.SH AUTHOR
  135. XDave Taylor, Hewlett-Packard Laboratories
  136. X.SH SEE ALSO
  137. X.I "Elm Alias Users Guide", 
  138. Xby Dave Taylor
  139. X.sp
  140. X.br
  141. Xnewalias(1L), checkalias(1L), mail(1), mailx(1), from(1L), printmail(1L)
  142. X.SH FILES
  143. X$home/.alias_hash             individual alias hash table
  144. X.br
  145. X$home/.alias_data             individual alias data table
  146. X.br
  147. X/tmp/snd*                     edit buffer for outgoing mail
  148. END_OF_doc/answer.1
  149. if test 1814 -ne `wc -c <doc/answer.1`; then
  150.     echo shar: \"doc/answer.1\" unpacked with wrong size!?
  151. fi
  152. # end of overwriting check
  153. fi
  154. echo shar: Extracting \"doc/autoreply.1\" \(1836 characters\)
  155. if test -f doc/autoreply.1 ; then 
  156.   echo shar: Will not over-write existing file \"doc/autoreply.1\"
  157. else
  158. sed "s/^X//" >doc/autoreply.1 <<'END_OF_doc/autoreply.1'
  159. X.TH AUTOREPLY 1L 
  160. X.ad b
  161. X.SH NAME
  162. Xautoreply - Automatic mail reply system
  163. X.SH SYNOPSIS
  164. X.B autoreply
  165. X.br
  166. X.B "autoreply off"
  167. X.br
  168. X.B autoreply
  169. X<
  170. X.B filename
  171. X>
  172. X.PP
  173. X.SH HP-UX COMPATIBILITY
  174. X.TP 10
  175. XSystems:
  176. XAT&T System V and Berkeley BSD
  177. X.TP
  178. XOrigin:
  179. XHewlett-Packard
  180. X.SH DESCRIPTION
  181. X.I Autoreply\^
  182. Xis a part of the 
  183. X.B Elm
  184. Xmail system and is designed to enable users to easily set up
  185. Xan automatic response to all mail they receive.  This is
  186. Xtypically during a vacation or some other period of time that
  187. Xthe user is not available to reply to mail (although some
  188. Xpeople get enough mail that they have it permanently running
  189. Xto simply send an "ack" to each message)
  190. X.PP
  191. XThe system is quite easy to use...
  192. XYou can type "autoreply" and be informed of your current
  193. Xstatus in the system (on or off), or "autoreply off" will
  194. Xturn your autoreplying off.
  195. X.PP
  196. XTo add yourself to the system, you need merely to compose a
  197. Xform response in a file somewhere, then type "autoreply <file>"
  198. Xwhere <file> is the name of the file.
  199. X.SH "SPECIAL NOTE"
  200. XFor this to function correctly, the program "arepdaemon" must
  201. Xbe running as a daemon in background.  This program automatically
  202. Xchecks all the currently enrolled users for new mail in their
  203. Xmailboxes...
  204. X.SH AUTHOR
  205. XDave Taylor, Hewlett-Packard Laboratories.
  206. X.SH SEE ALSO
  207. X.I "Elm Users Guide", 
  208. Xby Dave Taylor
  209. X.sp
  210. X.br
  211. Xmail(1), mailx(1), elm(1L)
  212. X.SH "BUGS"
  213. XUnfortunately, this program isn't too brilliant about identifying
  214. Xmail that shouldn't be responded to (like mail from other
  215. Xdaemons, or your mother) but that's a more general problem anyway.
  216. X.sp
  217. XAlso, occasionally a user will remove themselves from the
  218. Xautoreply system and the system won't turn their autoreply
  219. Xoff.  This is a problem that hasn't been solved yet (obviously
  220. Xsince it's in the "bugs" section!!) and any further information
  221. Xwould be appreciated!
  222. END_OF_doc/autoreply.1
  223. if test 1836 -ne `wc -c <doc/autoreply.1`; then
  224.     echo shar: \"doc/autoreply.1\" unpacked with wrong size!?
  225. fi
  226. # end of overwriting check
  227. fi
  228. echo shar: Extracting \"doc/checkalias.1\" \(941 characters\)
  229. if test -f doc/checkalias.1 ; then 
  230.   echo shar: Will not over-write existing file \"doc/checkalias.1\"
  231. else
  232. sed "s/^X//" >doc/checkalias.1 <<'END_OF_doc/checkalias.1'
  233. X.TH CHECKALIAS 1L
  234. X.ad b
  235. X.SH NAME
  236. Xcheckalias - check to see if an alias is defined.
  237. X.SH SYNOPSIS
  238. X.B checkalias
  239. Xalias, alias, ...
  240. X.SH HP-UX COMPATIBILITY
  241. X.TP 10
  242. XLevel:
  243. XHP-UX/CONTRIBUTED
  244. X.TP
  245. XOrigin:
  246. XHewlett-Packard
  247. X.SH DESCRIPTION
  248. X.I Checkalias
  249. Xchecks the user file first, and then the system alias file
  250. Xto try to find the specified alias or aliases.  If found, 
  251. Xthe value of the alias is printed out, otherwise an error
  252. Xis generated.
  253. X.P
  254. XNote: this is in fact a one-line shell script;
  255. X.nf
  256. X
  257. X    elm -c $*
  258. X
  259. X.fi
  260. X.SH AUTHOR
  261. XDave Taylor, Hewlett-Packard Laboratories
  262. X.SH SEE\ ALSO
  263. Xnewalias(1L), elm(1L), mail(1), mailx(1)
  264. X.SH BUGS
  265. XNote that the precedence of aliases is user file then system
  266. Xfile.  This means that a user can 'overload' an alias by having
  267. Xone defined in the system file also defined in theirs.  This
  268. Xshouldn't turn out to be a problem, but is something for
  269. Xthe system administrator to keep in mind when creating the
  270. Xsystem alias file.
  271. END_OF_doc/checkalias.1
  272. if test 941 -ne `wc -c <doc/checkalias.1`; then
  273.     echo shar: \"doc/checkalias.1\" unpacked with wrong size!?
  274. fi
  275. # end of overwriting check
  276. fi
  277. echo shar: Extracting \"doc/elm-help.0\" \(1802 characters\)
  278. if test -f doc/elm-help.0 ; then 
  279.   echo shar: Will not over-write existing file \"doc/elm-help.0\"
  280. else
  281. sed "s/^X//" >doc/elm-help.0 <<'END_OF_doc/elm-help.0'
  282. X
  283. X        Command                     Action
  284. X
  285. X       |         Pipe current message to ...
  286. X       !        Shell escape
  287. X       $        Resynchronize mailbox (force it)
  288. X           ?            This screen of information
  289. X           +, <SPACE>   Next page of headers
  290. X           -            Previous page of headers
  291. X           =            Set current message to 1
  292. X       *        Set current message to last message
  293. X           <n>          Set current message to n
  294. X       /        Search from/subjects for pattern
  295. X       //        Search entire message bodies for pattern
  296. X       >        Save current message or tagged to file
  297. X       <        Scan current message for calendar entries
  298. X
  299. X           a            Alias, change to 'alias' mode 
  300. X       b        Bounce (remail) current message
  301. X           c            Change current mail file
  302. X           d            Delete current message
  303. X      ^D        Delete messages with specified patter
  304. X       e        Edit the current mailbox
  305. X           f            Forward message to specified user
  306. X       g            Group (all recipients) reply to message
  307. X       h        Headers displayed with message
  308. X           j        Increment current message by one
  309. X       k        Decrement current message by one
  310. X           m            Mail to arbitrary user(s)
  311. X           n            Next message (Read current, then increment)
  312. X       o        Change Elm options
  313. X       p            print current message
  314. X           q            Quit - mail deleted, saved in mbox or left.
  315. X           r            Reply to current message
  316. X           s            Save message to specified file
  317. X       t        Tag a message for further operations
  318. X      ^T        Tag messages with specified pattern
  319. X           u            Undelete current message
  320. X           x            Exit - don't record as read, don't save...
  321. X
  322. X          ^L            Rewrite screen.
  323. X      <RETURN>    Read current message
  324. X      ^Q, DEL    Exit - don't record as read, don't save...
  325. END_OF_doc/elm-help.0
  326. if test 1802 -ne `wc -c <doc/elm-help.0`; then
  327.     echo shar: \"doc/elm-help.0\" unpacked with wrong size!?
  328. fi
  329. # end of overwriting check
  330. fi
  331. echo shar: Extracting \"doc/elm-help.1\" \(847 characters\)
  332. if test -f doc/elm-help.1 ; then 
  333.   echo shar: Will not over-write existing file \"doc/elm-help.1\"
  334. else
  335. sed "s/^X//" >doc/elm-help.1 <<'END_OF_doc/elm-help.1'
  336. X
  337. X                Commands available from the Options Menu
  338. X
  339. XChar    Meaning
  340. X----    -------
  341. X  c     Change `calendar' file to the file specified.  See '<' at top level 
  342. X        menu for more information on this.
  343. X
  344. X  d     Display pager.  `builtin' will use the built-in pager, or you
  345. X        can put anything else you'd like, including "/bin/more"
  346. X
  347. X  e     Editor to use when composing messages
  348. X
  349. X  f     Folder directory.  This is what '=', '+', or '%' expands to.
  350. X
  351. X  s     Sorting criteria.  Step through with space, <return> selects.
  352. X
  353. X  o     Outbound mail file.  Where to save copies of outbound mail.
  354. X
  355. X  p     How to print messages.  '%s' can be used as a filename holder
  356. X
  357. X  y     Your fullname for outbound mail.
  358. X
  359. X  a     arrow cursor.  Changes from "->" to inverse bar and back
  360. X
  361. X  m     display mini-menus or not.  Expert users usually don't.
  362. END_OF_doc/elm-help.1
  363. if test 847 -ne `wc -c <doc/elm-help.1`; then
  364.     echo shar: \"doc/elm-help.1\" unpacked with wrong size!?
  365. fi
  366. # end of overwriting check
  367. fi
  368. echo shar: Extracting \"doc/elm-help.2\" \(462 characters\)
  369. if test -f doc/elm-help.2 ; then 
  370.   echo shar: Will not over-write existing file \"doc/elm-help.2\"
  371. else
  372. sed "s/^X//" >doc/elm-help.2 <<'END_OF_doc/elm-help.2'
  373. X
  374. X                Commands available from the Alias Menu
  375. X
  376. XChar    Meaning
  377. X----    -------
  378. X
  379. X  ?     help on a specific key, or this summary of commands.
  380. X
  381. X  a     Add return address of current message to alias database
  382. X
  383. X  m     Make new user alias, adding to alias database when done
  384. X
  385. X  r,x   return from the alias menu
  386. X                      
  387. X  p     check for a person in the alias database
  388. X        
  389. X  s     check for a system in the host routing/domain database
  390. X
  391. END_OF_doc/elm-help.2
  392. if test 462 -ne `wc -c <doc/elm-help.2`; then
  393.     echo shar: \"doc/elm-help.2\" unpacked with wrong size!?
  394. fi
  395. # end of overwriting check
  396. fi
  397. echo shar: Extracting \"doc/elmrc.sample\" \(1520 characters\)
  398. if test -f doc/elmrc.sample ; then 
  399.   echo shar: Will not over-write existing file \"doc/elmrc.sample\"
  400. else
  401. sed "s/^X//" >doc/elmrc.sample <<'END_OF_doc/elmrc.sample'
  402. X#
  403. X# .msgrc - automatic variable defines for the 'msg' mailer.
  404. X#
  405. X# Personalized for ??
  406. X# 
  407. X
  408. X# where to save my mail to, default directory
  409. Xmaildir  = ~/Mail
  410. X
  411. X# where to save messages to, default file
  412. Xmailbox  = ~/Mail/mailbox
  413. X
  414. X# what editor to use
  415. Xeditor   = $EDITOR
  416. X
  417. X# where to save mail if not specified somewhere else
  418. Xsavemail = ~/Mail/mail.sent
  419. X
  420. X# how to print a message ('%s' is the filename)
  421. Xprint    = /usr/local/bin/print -p lpn -f %s
  422. X
  423. X# prefix sequence for including message text in other messages...
  424. Xprefix = > 
  425. X
  426. X# what headers I DON'T want to see, ever.
  427. X
  428. Xweedout  = "Via:"  "Sent:"  "Date:"  "Status:"  "Original"
  429. X       "From"  "Phase"  "Subject:"  "Fruit"  "Sun"
  430. X       "Lat"  "Buzzword"  "Return"  "Posted" "Telephone"
  431. X       "Postal-Address" "Origin" "X-Sent-By-Nmail-V"
  432. X       "Resent" "X-Location"  "Source" "Mood"  "Neuron"
  433. X       "Libido" "To:" "X-Mailer:"  "Full-Name:" "X-HPMAIL"
  434. X       "Cc:" "cc:" "Mmdf" "Network-"
  435. X
  436. X# automatically copy message being replied to into buffer? 
  437. Xautocopy = OFF
  438. X
  439. X# save a copy of all outbound messages? 
  440. Xcopy     = ON
  441. X
  442. X# emulate the mailx message increment mode (only increment after something
  443. X# has been 'done' to a message, either saved or deleted)
  444. Xresolve  = ON
  445. X
  446. X# enable the weedout list to be read...
  447. Xweed     = ON
  448. X
  449. X# when messages are copied into the outbound buffer, don't include headers
  450. Xnoheader = ON
  451. X
  452. X# display message title when displaying pages of message
  453. Xtitles     = ON
  454. X
  455. X# alternative addresses that I could receive mail from (usually a
  456. X# forwarding mailbox)
  457. X
  458. X# alternatives = 
  459. END_OF_doc/elmrc.sample
  460. if test 1520 -ne `wc -c <doc/elmrc.sample`; then
  461.     echo shar: \"doc/elmrc.sample\" unpacked with wrong size!?
  462. fi
  463. # end of overwriting check
  464. fi
  465. echo shar: Extracting \"doc/filter.1\" \(2330 characters\)
  466. if test -f doc/filter.1 ; then 
  467.   echo shar: Will not over-write existing file \"doc/filter.1\"
  468. else
  469. sed "s/^X//" >doc/filter.1 <<'END_OF_doc/filter.1'
  470. X.TH FILTER 1L
  471. X.ad b
  472. X.SH NAME
  473. Xfilter - filter incoming messages before adding to mailbox
  474. X.SH SYNOPSIS
  475. X.B filter
  476. X[-a]
  477. X[-v]
  478. X.br
  479. X.B filter
  480. X[-n]
  481. X.br
  482. X.B filter
  483. X[-r]
  484. X.br
  485. X.B filter
  486. X[-c] [-s]
  487. X.br
  488. X.B filter
  489. X[-c] [-S]
  490. X.SH HP-UX COMPATIBILITY
  491. X.TP 10
  492. XLevel:
  493. XHP-UX/CONTRIBUTED
  494. X.TP
  495. XOrigin:
  496. XHewlett-Packard Laboratories
  497. X.SH DESCRIPTION
  498. X.I Filter
  499. Xis a sophisticated program that allows incoming mail to be
  500. Xfiltered against a wide set of criteria.  The format for the
  501. Xrules, located in $HOME/.filter_rules, is;
  502. X.nf
  503. X    
  504. X    if (\fIcondition\fR) then \fIaction\fR
  505. X
  506. X.fi
  507. Xwhere \fIcondition\fR can be any number of occurances of 
  508. X``\fIfield\fR \fIrelationship\fR "\fIvalue\fR"'' joined by
  509. X\fBand\fR statements and optionally prepended with a \fBnot\fR
  510. Xstatement.  Note that the \fBor\fR statement is not currently
  511. Xsupported as a logical conjunction.
  512. X.sp
  513. X\fIField\fR can be ``from'', ``subject'', ``to'',
  514. X``lines'' or ``contains'', \fIrelationship\fR can be either `='
  515. Xor, for ``lines'', `<', `>', `<=', `>=', or '!=' too.
  516. X.nf
  517. X
  518. X    delete
  519. X    save     \fIfoldername\fR
  520. X    savecopy \fIfoldername\fR
  521. X    execute  \fIcommand\fR
  522. X    forward  \fIaddress\fR
  523. X    leave
  524. X
  525. X.fi
  526. XThe flags are;
  527. X.TP 1.0i
  528. X.B "-a"
  529. XAudible.  Output a beep with each filter action message (use with \fB-v\fR).
  530. X.TP
  531. X.B "-c"
  532. XClear Logs.  If this flag is used, the log files will be removed after
  533. Xbeing summarized by either "-s" or "-S" (see below).
  534. X.TP
  535. X.B "-n"
  536. XNot-Really.  Output what would happen if given message from standard
  537. Xinput, but don't actually do anything with it.
  538. X.TP
  539. X.B "-r"
  540. XRules.  List the rules currently being used.
  541. X.TP
  542. X.B "-s"
  543. XSummarize.  List a summary of the messages filtered since the last summary
  544. Xand zero the log file.
  545. X.TP
  546. X.B "-S"
  547. XSummarize in a more verbose format.
  548. X.TP
  549. X.B "-v"
  550. XVerbose.  Give output on standard out for each message filtered.  Useful
  551. Xto have redirected to ``/dev/console'' and such.  (see \fB-a\fR too).
  552. X.SH AUTHOR
  553. XDave Taylor, Hewlett-Packard Laboratories.
  554. X.SH FILES
  555. X$HOME/.filter-rules     The ruleset for the users filter
  556. X.br
  557. X$HOME/.filterlog        A log of what has been done
  558. X.br
  559. X$HOME/.filtersum        A summary of what has been done
  560. X.br
  561. X/etc/passwd             Used to get users home directory
  562. X.SH SEE\ ALSO
  563. X\fIThe Elm Filter Guide\fR, by Dave Taylor.
  564. X.br
  565. Xreadmsg(1L), elm(1L), mail(1), mailx(1), sendmail(1,8)
  566. X.SH COMMENTS
  567. XNot real smart about pattern matching.  
  568. END_OF_doc/filter.1
  569. if test 2330 -ne `wc -c <doc/filter.1`; then
  570.     echo shar: \"doc/filter.1\" unpacked with wrong size!?
  571. fi
  572. # end of overwriting check
  573. fi
  574. echo shar: Extracting \"doc/from.1\" \(1055 characters\)
  575. if test -f doc/from.1 ; then 
  576.   echo shar: Will not over-write existing file \"doc/from.1\"
  577. else
  578. sed "s/^X//" >doc/from.1 <<'END_OF_doc/from.1'
  579. X.TH FROM 1L
  580. X.ad b
  581. X.SH NAME
  582. Xfrom - list from and subject of all messages in mailbox or file
  583. X.SH SYNOPSIS
  584. X.B from
  585. X[-n]
  586. X[ filename ]
  587. X.br
  588. X.B from
  589. X[-n]
  590. X[ username ]
  591. X.SH HP-UX COMPATIBILITY
  592. X.TP 10
  593. XLevel:
  594. XHP-UX/CONTRIBUTED
  595. X.TP
  596. XOrigin:
  597. XHewlett-Packard
  598. X.SH DESCRIPTION
  599. X.I From
  600. Xoutputs a line per message in the current users mailbox 
  601. Xof the form;
  602. X.PP
  603. X<from> [subject]
  604. X.PP
  605. XIf a filename is specified, the program reads that file
  606. Xrather than the default file.  If the argument is a
  607. X\fIusername\fR then look for that users mailbox.
  608. X.PP
  609. XFurthermore, if the \fI-n\fR flag is specified, the headers
  610. Xwill be numbered using the same numbering scheme that, for
  611. Xexample, \fIreadmsg\fR will understand.
  612. X.PP
  613. XFilename can be specified with the same notation as
  614. Xwhen invoking the \fBElm\fR mailer.
  615. X.SH AUTHOR
  616. XDave Taylor, Hewlett-Packard Laboratories.
  617. X.SH SEE\ ALSO
  618. Xreadmsg(1L), elm(1L), mail(1), mailx(1)
  619. X.SH BUGS
  620. XOccasionally it gets confused about whether a message has
  621. Xa subject or not.  This, unfortunately, is due to the
  622. Xvast number of possible headers in the messages...
  623. END_OF_doc/from.1
  624. if test 1055 -ne `wc -c <doc/from.1`; then
  625.     echo shar: \"doc/from.1\" unpacked with wrong size!?
  626. fi
  627. # end of overwriting check
  628. fi
  629. echo shar: Extracting \"doc/listalias.1\" \(806 characters\)
  630. if test -f doc/listalias.1 ; then 
  631.   echo shar: Will not over-write existing file \"doc/listalias.1\"
  632. else
  633. sed "s/^X//" >doc/listalias.1 <<'END_OF_doc/listalias.1'
  634. X.TH LISTALIAS 1L
  635. X.ad b
  636. X.SH NAME
  637. Xlistalias - list user and system aliases
  638. X.SH SYNOPSIS
  639. X.B listalias
  640. X[ regular-expression ]
  641. X.SH HP-UX COMPATIBILITY
  642. X.TP 10
  643. XLevel:
  644. XHP-UX/CONTRIBUTED
  645. X.TP
  646. XOrigin:
  647. XHewlett-Packard Laboratories
  648. X.SH DESCRIPTION
  649. X.I Listalias
  650. Xoutputs a line per alias in both the user and the system 
  651. Xaliases.  Each line is of the form;
  652. X.nf
  653. X   
  654. X   <alias>     <address>  (<comment>)
  655. X
  656. X.fi
  657. XIf an optional regular expression is used, just the aliases
  658. Xthat match the specified expression are listed.  If not, 
  659. Xthey are all listed.
  660. X.sp
  661. XEither way, the output is sorted.
  662. X.SH AUTHOR
  663. XDave Taylor, Hewlett-Packard Laboratories.
  664. X.SH SEE\ ALSO
  665. Xnewalias(1L), elm(1L), checkalias(1L)
  666. X.SH BUGS
  667. XSince the program uses a pipe to egrep, how expressions are evaluated is
  668. Xa function of \fIthat\fR program, not this one!
  669. END_OF_doc/listalias.1
  670. if test 806 -ne `wc -c <doc/listalias.1`; then
  671.     echo shar: \"doc/listalias.1\" unpacked with wrong size!?
  672. fi
  673. # end of overwriting check
  674. fi
  675. echo shar: Extracting \"doc/messages.1\" \(518 characters\)
  676. if test -f doc/messages.1 ; then 
  677.   echo shar: Will not over-write existing file \"doc/messages.1\"
  678. else
  679. sed "s/^X//" >doc/messages.1 <<'END_OF_doc/messages.1'
  680. X.TH MESSAGES 1L
  681. X.ad b
  682. X.SH NAME
  683. Xmessages - quick count of messages in mailbox or folder
  684. X.SH SYNOPSIS
  685. X.B messages
  686. X.br
  687. X.B messages
  688. Xfolder-name
  689. X.SH HP-UX COMPATIBILITY
  690. X.TP 10
  691. XLevel:
  692. XHP-UX/CONTRIBUTED
  693. X.TP
  694. XOrigin:
  695. XHewlett-Packard
  696. X.SH DESCRIPTION
  697. X.I Messages
  698. Xcounts the occurances of "^From\ " in either the current incoming 
  699. Xmailbox or the specified folder.
  700. X.P
  701. XThis is, in fact, a simple little shell script!!
  702. X.SH AUTHOR
  703. XDave Taylor, Hewlett-Packard Laboratories
  704. X.SH SEE\ ALSO
  705. Xfrom(1L), elm(1L)
  706. X.SH BUGS
  707. XDon't be foolish...
  708. END_OF_doc/messages.1
  709. if test 518 -ne `wc -c <doc/messages.1`; then
  710.     echo shar: \"doc/messages.1\" unpacked with wrong size!?
  711. fi
  712. # end of overwriting check
  713. fi
  714. echo shar: Extracting \"doc/newalias.1\" \(2407 characters\)
  715. if test -f doc/newalias.1 ; then 
  716.   echo shar: Will not over-write existing file \"doc/newalias.1\"
  717. else
  718. sed "s/^X//" >doc/newalias.1 <<'END_OF_doc/newalias.1'
  719. X.TH NEWALIAS 1L
  720. X.ad b
  721. X.SH NAME
  722. Xnewalias - install new elm aliases for user and/or system
  723. X.SH SYNOPSIS
  724. X.B newalias
  725. X[-q]
  726. X.SH HP-UX COMPATIBILITY
  727. X.TP 10
  728. XLevel:
  729. XHP-UX/CONTRIBUTED
  730. X.TP
  731. XOrigin:
  732. XHewlett-Packard
  733. X.SH DESCRIPTION
  734. X.I Newalias
  735. Xcreates new hash and data files from a text file.  If the
  736. Xprogram is invoked by any account other than the superuser
  737. Xaccount, the program looks for a file 
  738. Xcalled $home/.alias_text
  739. Xand, upon finding it, creates files $home/.alias_hash and
  740. X$home/.alias_data for the 
  741. X.I Elm
  742. Xprogram.
  743. X.PP
  744. XIf the superuser invokes the program, they are given the
  745. Xoption of either updating their personal alias files or
  746. Xthe system alias files.
  747. XThe question can be supressed, with the default being
  748. Xthe user files for the superuser, if the ``-q'' flag is
  749. Xpresent upon invokation.
  750. X.PP
  751. XThe format that the program expects is;
  752. X.sp
  753. X.nf
  754. X    alias, alias, .. : comment : address
  755. Xor
  756. X    alias, alias, .. : comment : alias, alias, ...
  757. X   
  758. XThe first form is for an individual user such as;
  759. X
  760. X    dave, taylor : Dave Taylor : veeger!hpcnou!dat
  761. X
  762. Xand the second is for defining a group alias such as;
  763. X
  764. X    gurus : Unix Gurus : alan, john, dave, mike, richard,
  765. X                     larry, t_richardson
  766. X
  767. X.fi
  768. X.sp
  769. XNote that lines can be continued at will, blank lines are accepted
  770. Xwithout error, and that any line starting with '#' is considered a
  771. Xcomment and is not processed.
  772. X.PP
  773. XThe comment field is thrown away by this program, but it is 
  774. Xrecommended that it contain the name of the user who the alias
  775. Xis for.
  776. X.PP
  777. XFinally, aliases can contain other aliases, and/or groups;
  778. X.sp
  779. X.nf
  780. X    unix : Unix people : gurus, taylor, jonboy
  781. X.fi
  782. X' onto the next page, if you please
  783. X.sp 3
  784. X.SH FILES
  785. X$home/.alias_text               alias source for user 
  786. X.br
  787. X$home/.alias_hash               alias hash table for user
  788. X.br
  789. X$home/.alias_data               alias data file for user
  790. X.br
  791. X/usr/mail/.alias_text           alias source for system
  792. X.br
  793. X/usr/mail/.alias_hash           alias hash table for system
  794. X.br
  795. X/usr/mail/.alias_data           alias data file for system
  796. X.SH AUTHOR
  797. XDave Taylor, Hewlett-Packard Laboratories.
  798. X.SH SEE\ ALSO
  799. Xelm(1L), checkalias(1L), mail(1), mailx(1)
  800. X.SH DIAGNOSTICS
  801. XNewalias has a couple of descriptive error messages which
  802. Xdon't need to be detailed here.  It is, however, worth
  803. Xnoting that the
  804. X.I checkalias
  805. Xprogram can be used to ensure that the aliases are in the
  806. Xproper order and are available for the 
  807. X.I Elm
  808. Xsystem.
  809. END_OF_doc/newalias.1
  810. if test 2407 -ne `wc -c <doc/newalias.1`; then
  811.     echo shar: \"doc/newalias.1\" unpacked with wrong size!?
  812. fi
  813. # end of overwriting check
  814. fi
  815. echo shar: Extracting \"doc/newmail.1\" \(1377 characters\)
  816. if test -f doc/newmail.1 ; then 
  817.   echo shar: Will not over-write existing file \"doc/newmail.1\"
  818. else
  819. sed "s/^X//" >doc/newmail.1 <<'END_OF_doc/newmail.1'
  820. X.TH NEWMAIL 1L 
  821. X.ad b
  822. X.SH NAME
  823. Xnewmail - daemon to asynchronously notify of new mail
  824. X.SH SYNOPSIS
  825. X.B newmail
  826. X.br
  827. X.B newmail
  828. Xfilename
  829. X.PP
  830. X.SH HP-UX COMPATIBILITY
  831. X.TP 10
  832. XLevel:
  833. XHP-UX/CONTRIBUTED
  834. X.TP
  835. XOrigin:
  836. XHewlett-Packard
  837. X.SH DESCRIPTION
  838. X.I Newmail\^
  839. Xis a daemon designed to run in background and every 60 seconds
  840. Xcheck to see if there is any new mail for the user that
  841. Xstarted it up.
  842. X.P
  843. XIf there is new mail, the program will asynchronously write to
  844. Xthe terminal that it was started on a message of the form
  845. X.nf
  846. X
  847. X   New mail from <name> - <subject>
  848. X
  849. X.fi
  850. Xwhere <name> is either the name of the person sending it,
  851. Xif available (the ARPA 'From:' line) or machine!login where
  852. Xmachine is the machine the mail was sent from.  If there
  853. Xis no subject, the message "<no subject>" will appear on
  854. Xthe screen.
  855. X.P
  856. XIf the message is a \fIpriority\fR message (that is, it has a field
  857. Xin the header "Priority:"), then the line will be "PRIORITY mail"
  858. Xinstead of "New mail".
  859. X.P
  860. XThis program will run forever, and can internally reset 
  861. Xitself if mail is deleted from the incoming mailbox while
  862. Xtrying to monitor it.
  863. X.P
  864. XIf \fBnewmail\fR is started up with a filename, it will
  865. Xperform exactly the same, but with the specified file as
  866. Xthe one to check rather than the default users mailbox.
  867. X.SH AUTHOR
  868. XDave Taylor, Hewlett-Packard Laboratories.
  869. X.SH SEE ALSO
  870. Xnotify in sh(1) or csh(1), announce(1L)
  871. END_OF_doc/newmail.1
  872. if test 1377 -ne `wc -c <doc/newmail.1`; then
  873.     echo shar: \"doc/newmail.1\" unpacked with wrong size!?
  874. fi
  875. # end of overwriting check
  876. fi
  877. echo shar: Extracting \"doc/printmail.1\" \(809 characters\)
  878. if test -f doc/printmail.1 ; then 
  879.   echo shar: Will not over-write existing file \"doc/printmail.1\"
  880. else
  881. sed "s/^X//" >doc/printmail.1 <<'END_OF_doc/printmail.1'
  882. X.TH PRINTMAIL 1L
  883. X.ad b
  884. X.SH NAME
  885. Xprintmail - format mail in a readable fashion for printing
  886. X.SH SYNOPSIS
  887. X.B printmail
  888. X{-d}
  889. X{filename}
  890. X.SH HP-UX COMPATIBILITY
  891. X.TP 10
  892. XLevel:
  893. XHP-UX/CONTRIBUTED
  894. X.TP
  895. XOrigin:
  896. XHewlett-Packard
  897. X.SH DESCRIPTION
  898. X.I Printmail
  899. Xcopies all messages from either the file specified or the
  900. Xdefault user mailbox separated by form feeds to standard output.  
  901. XWith the
  902. X.B \-d
  903. Xoption, the messages are separated by a dashed line
  904. Xrather than the formfeed (for lots of little mail).
  905. X.sp
  906. X.P
  907. XIf the program is given a file as standard input, it will
  908. Xuse that instead of the default mailbox for the operation
  909. Xspecified.
  910. X.SH EXAMPLE
  911. XA typical usage of this command is;
  912. X.nf
  913. X    printmail -d | print 
  914. X.fi
  915. X.SH AUTHOR
  916. XDave Taylor, Hewlett-Packard Laboratories.
  917. X.SH SEE\ ALSO
  918. Xelm(1L), mail(1), mailx(1), from(1L)
  919. END_OF_doc/printmail.1
  920. if test 809 -ne `wc -c <doc/printmail.1`; then
  921.     echo shar: \"doc/printmail.1\" unpacked with wrong size!?
  922. fi
  923. # end of overwriting check
  924. fi
  925. echo shar: Extracting \"doc/trim-headers.1\" \(958 characters\)
  926. if test -f doc/trim-headers.1 ; then 
  927.   echo shar: Will not over-write existing file \"doc/trim-headers.1\"
  928. else
  929. sed "s/^X//" >doc/trim-headers.1 <<'END_OF_doc/trim-headers.1'
  930. X.TH TRIM-HEADERS 1L
  931. X.ad b
  932. X.SH NAME
  933. Xtrim-headers - help keep mailbox files clean of trash headers
  934. X.SH SYNOPSIS
  935. Xcat \fIfilename\fR |
  936. X.B trim-headers
  937. X> \fIfilename2\fR
  938. X.br
  939. X.B trim-headers
  940. Xfilename-list
  941. X.SH HP-UX COMPATIBILITY
  942. X.TP 10
  943. XLevel:
  944. XHP-UX/CONTRIBUTED
  945. X.TP
  946. XOrigin:
  947. XHewlett-Packard Laboratories
  948. X.SH DESCRIPTION
  949. X.I Trim-headers
  950. Xis a simple awk script that removes all headers from the specified
  951. Xfolder, either standard input or one of a list of filenames, according
  952. Xto how it's invoked.  The program knows about the following headers;
  953. X.sp
  954. X.nf
  955. X    From 
  956. X    From:
  957. X    Subject:
  958. X    To:
  959. X    Cc:
  960. X    Date:
  961. X
  962. X.fi
  963. XAll other headers are considered extraneous and are removed.
  964. X.SH AUTHOR
  965. XDave Taylor, Hewlett-Packard Laboratories
  966. X.SH SEE\ ALSO
  967. Xawk(1), printmail(1L), readmsg(1L)
  968. X.SH BUGS
  969. XThe current incancation of the \fIawk\fR script doesn't understand
  970. Xthe idea of multiple line header fields, so a message that has, say,
  971. Xa three line To: list will only have the first line saved...
  972. END_OF_doc/trim-headers.1
  973. if test 958 -ne `wc -c <doc/trim-headers.1`; then
  974.     echo shar: \"doc/trim-headers.1\" unpacked with wrong size!?
  975. fi
  976. # end of overwriting check
  977. fi
  978. echo shar: Extracting \"doc/wnewmail.1\" \(1502 characters\)
  979. if test -f doc/wnewmail.1 ; then 
  980.   echo shar: Will not over-write existing file \"doc/wnewmail.1\"
  981. else
  982. sed "s/^X//" >doc/wnewmail.1 <<'END_OF_doc/wnewmail.1'
  983. X.TH WNEWMAIL 1L 
  984. X.ad b
  985. X.SH NAME
  986. Xwnewmail - daemon to asynchronously notify of new mail
  987. X.SH SYNOPSIS
  988. X.B wnewmail
  989. X.br
  990. X.B wnewmail
  991. Xfilename
  992. X.PP
  993. X.SH HP-UX COMPATIBILITY
  994. X.TP 10
  995. XLevel:
  996. XHP-UX/CONTRIBUTED
  997. X.TP
  998. XOrigin:
  999. XHewlett-Packard
  1000. X.SH DESCRIPTION
  1001. X.I Wnewmail\^
  1002. Xis a daemon designed to run in \fBa window\fR on a windowing
  1003. Xsystem (such as an HP or Sun system) and check every 10 seconds
  1004. Xto see if there is any new mail for the user that
  1005. Xstarted it up.
  1006. X.P
  1007. XIf there is new mail, the program will "beep", and write to
  1008. Xthe window for each of the new messages;
  1009. X.nf
  1010. X
  1011. X   Mail from <name> -- <subject>
  1012. X
  1013. X.fi
  1014. Xwhere <name> is either the name of the person sending it,
  1015. Xif available (the ARPA 'From:' line) or machine!login where
  1016. Xmachine is the machine the mail was sent from.  If there
  1017. Xis no subject, the message "<no subject>" will appear on
  1018. Xthe screen.
  1019. X.P
  1020. XIf the message is a \fIpriority\fR message (that is, the
  1021. Xheader contains a line "Priority:"), then the line output
  1022. Xwill be "PRIORITY mail from ..." rather than just "Mail from".
  1023. X.P
  1024. XThis program will run forever, and can internally reset 
  1025. Xitself if mail is deleted from the incoming mailbox while
  1026. Xtrying to monitor it.
  1027. X.P
  1028. XIf \fBwnewmail\fR is started up with a filename, it will
  1029. Xperform exactly the same, but with the specified file as
  1030. Xthe one to check rather than the default users mailbox.
  1031. X.SH AUTHOR
  1032. XDave Taylor, Hewlett-Packard Laboratories.
  1033. X.SH SEE ALSO
  1034. Xnotify in sh(1) or csh(1), newmail(1L)
  1035. X.SH NOTE
  1036. XThis is almost identical to the program \fBnewmail\fR...
  1037. END_OF_doc/wnewmail.1
  1038. if test 1502 -ne `wc -c <doc/wnewmail.1`; then
  1039.     echo shar: \"doc/wnewmail.1\" unpacked with wrong size!?
  1040. fi
  1041. # end of overwriting check
  1042. fi
  1043. if test ! -d filter ; then
  1044.     echo shar: Creating directory \"filter\"
  1045.     mkdir filter
  1046. fi
  1047. echo shar: Extracting \"filter/Makefile\" \(1172 characters\)
  1048. if test -f filter/Makefile ; then 
  1049.   echo shar: Will not over-write existing file \"filter/Makefile\"
  1050. else
  1051. sed "s/^X//" >filter/Makefile <<'END_OF_filter/Makefile'
  1052. X#
  1053. X#  Makefile for the Elm system filter program
  1054. X#
  1055. X#         (C) Copyright 1986, Dave Taylor
  1056. X#
  1057. X#  Last modification: Oct 7th, 1986
  1058. X
  1059. XSHELL=/bin/sh
  1060. X
  1061. XDEFINE= -DBSD
  1062. XLIB2  = -lcurses
  1063. X
  1064. XCFLAGS= -O -I../hdrs
  1065. XCC=    /bin/cc
  1066. XRM=     /bin/rm -f
  1067. XECHO=  /bin/echo
  1068. X
  1069. XOBJ     =   ../bin/filter
  1070. XHDRS    =   ../hdrs/defs.h ../hdrs/sysdefs.h ../hdrs/filter.h
  1071. XBINARIES=   actions.o filter.o parse.o rules.o summarize.o utils.o utils2.o
  1072. XSRC     =   actions.c filter.c parse.c rules.c summarize.c utils.c utils2.c
  1073. X
  1074. Xall: ${OBJ}
  1075. X
  1076. X../bin/filter  : ${HDRS} ${BINARIES}
  1077. X    ${CC} ${CFLAGS} ${DEFINE} ${BINARIES} -o ${OBJ}
  1078. X
  1079. Xactions.o : ${HDRS} actions.c
  1080. X    ${CC} -c ${CFLAGS} ${DEFINE} actions.c
  1081. X
  1082. Xfilter.o : ${HDRS} filter.c
  1083. X    ${CC} -c ${CFLAGS} ${DEFINE} filter.c
  1084. X
  1085. Xparse.o : ${HDRS} parse.c
  1086. X    ${CC} -c ${CFLAGS} ${DEFINE} parse.c
  1087. X
  1088. Xutils.o : ${HDRS} utils.c
  1089. X    ${CC} -c ${CFLAGS} ${DEFINE} utils.c
  1090. X
  1091. Xutils2.o : ${HDRS} utils2.c
  1092. X    ${CC} -c ${CFLAGS} ${DEFINE} utils2.c
  1093. X
  1094. Xrules.o : ${HDRS} rules.c
  1095. X    ${CC} -c ${CFLAGS} ${DEFINE} rules.c
  1096. X
  1097. Xsummarize.o : ${HDRS} summarize.c
  1098. X    ${CC} -c ${CFLAGS} ${DEFINE} summarize.c
  1099. X
  1100. Xlint    : 
  1101. X    lint -I../hdrs ${SRC} > LINT.OUT
  1102. X
  1103. Xclean    :
  1104. X    ${RM} ${BINARIES}
  1105. X
  1106. Xindex   :
  1107. X    index ${SRC} > INDEX
  1108. X
  1109. END_OF_filter/Makefile
  1110. if test 1172 -ne `wc -c <filter/Makefile`; then
  1111.     echo shar: \"filter/Makefile\" unpacked with wrong size!?
  1112. fi
  1113. # end of overwriting check
  1114. fi
  1115. echo shar: Extracting \"filter/Makefile.mstr\" \(1167 characters\)
  1116. if test -f filter/Makefile.mstr ; then 
  1117.   echo shar: Will not over-write existing file \"filter/Makefile.mstr\"
  1118. else
  1119. sed "s/^X//" >filter/Makefile.mstr <<'END_OF_filter/Makefile.mstr'
  1120. X#
  1121. X#  Makefile for the Elm system filter program
  1122. X#
  1123. X#         (C) Copyright 1986, Dave Taylor
  1124. X#
  1125. X#  Last modification: Oct 7th, 1986
  1126. X
  1127. XSHELL=/bin/sh
  1128. X
  1129. XDEFINE= >os-define<
  1130. XLIB2  = >lib2<
  1131. X
  1132. XCFLAGS= -O -I../hdrs
  1133. XCC=    >cc<
  1134. XRM=     >rm<
  1135. XECHO=  /bin/echo
  1136. X
  1137. XOBJ     =   ../bin/filter
  1138. XHDRS    =   ../hdrs/defs.h ../hdrs/sysdefs.h ../hdrs/filter.h
  1139. XBINARIES=   actions.o filter.o parse.o rules.o summarize.o utils.o utils2.o
  1140. XSRC     =   actions.c filter.c parse.c rules.c summarize.c utils.c utils2.c
  1141. X
  1142. Xall: ${OBJ}
  1143. X
  1144. X../bin/filter  : ${HDRS} ${BINARIES}
  1145. X    ${CC} ${CFLAGS} ${DEFINE} ${BINARIES} -o ${OBJ}
  1146. X
  1147. Xactions.o : ${HDRS} actions.c
  1148. X    ${CC} -c ${CFLAGS} ${DEFINE} actions.c
  1149. X
  1150. Xfilter.o : ${HDRS} filter.c
  1151. X    ${CC} -c ${CFLAGS} ${DEFINE} filter.c
  1152. X
  1153. Xparse.o : ${HDRS} parse.c
  1154. X    ${CC} -c ${CFLAGS} ${DEFINE} parse.c
  1155. X
  1156. Xutils.o : ${HDRS} utils.c
  1157. X    ${CC} -c ${CFLAGS} ${DEFINE} utils.c
  1158. X
  1159. Xutils2.o : ${HDRS} utils2.c
  1160. X    ${CC} -c ${CFLAGS} ${DEFINE} utils2.c
  1161. X
  1162. Xrules.o : ${HDRS} rules.c
  1163. X    ${CC} -c ${CFLAGS} ${DEFINE} rules.c
  1164. X
  1165. Xsummarize.o : ${HDRS} summarize.c
  1166. X    ${CC} -c ${CFLAGS} ${DEFINE} summarize.c
  1167. X
  1168. Xlint    : 
  1169. X    lint -I../hdrs ${SRC} > LINT.OUT
  1170. X
  1171. Xclean    :
  1172. X    ${RM} ${BINARIES}
  1173. X
  1174. Xindex   :
  1175. X    index ${SRC} > INDEX
  1176. X
  1177. END_OF_filter/Makefile.mstr
  1178. if test 1167 -ne `wc -c <filter/Makefile.mstr`; then
  1179.     echo shar: \"filter/Makefile.mstr\" unpacked with wrong size!?
  1180. fi
  1181. # end of overwriting check
  1182. fi
  1183. if test ! -d hdrs ; then
  1184.     echo shar: Creating directory \"hdrs\"
  1185.     mkdir hdrs
  1186. fi
  1187. echo shar: Extracting \"hdrs/curses.h\" \(620 characters\)
  1188. if test -f hdrs/curses.h ; then 
  1189.   echo shar: Will not over-write existing file \"hdrs/curses.h\"
  1190. else
  1191. sed "s/^X//" >hdrs/curses.h <<'END_OF_hdrs/curses.h'
  1192. X/***             curses.h            ***/
  1193. X
  1194. X/*** (C) Copyright 1986 Dave Taylor            ***/
  1195. X
  1196. X     /*** Include file for seperate compilation.  ***/
  1197. X
  1198. X#define OFF        0
  1199. X#define ON         1
  1200. X
  1201. Xint  InitScreen(),      /* This must be called before anything else!! */
  1202. X
  1203. X     ClearScreen(),      CleartoEOLN(),
  1204. X
  1205. X     MoveCursor(),
  1206. X     CursorUp(),         CursorDown(), 
  1207. X     CursorLeft(),       CursorRight(), 
  1208. X
  1209. X     StartBold(),        EndBold(), 
  1210. X     StartUnderline(),   EndUnderline(), 
  1211. X     StartHalfbright(),  EndHalfbright(),
  1212. X     StartInverse(),     EndInverse(),
  1213. X    
  1214. X     transmit_functions(),
  1215. X
  1216. X     Raw(),              ReadCh();
  1217. X
  1218. Xchar *return_value_of();
  1219. END_OF_hdrs/curses.h
  1220. if test 620 -ne `wc -c <hdrs/curses.h`; then
  1221.     echo shar: \"hdrs/curses.h\" unpacked with wrong size!?
  1222. fi
  1223. # end of overwriting check
  1224. fi
  1225. echo shar: Extracting \"hdrs/save_opts.h\" \(2043 characters\)
  1226. if test -f hdrs/save_opts.h ; then 
  1227.   echo shar: Will not over-write existing file \"hdrs/save_opts.h\"
  1228. else
  1229. sed "s/^X//" >hdrs/save_opts.h <<'END_OF_hdrs/save_opts.h'
  1230. X/**             save_opts.h             **/
  1231. X
  1232. X/** Some crazy includes for the save-opts part of the Elm program!
  1233. X
  1234. X    (C) Copyright 1986, Dave Taylor
  1235. X**/
  1236. X
  1237. X#define ALTERNATIVES        0
  1238. X#define ALWAYSDELETE        1
  1239. X#define ALWAYSLEAVE        2
  1240. X#define ARROW            3
  1241. X#define AUTOCOPY        4
  1242. X#define BOUNCEBACK        5
  1243. X#define CALENDAR        6
  1244. X#define COPY            7
  1245. X#define EDITOR            8
  1246. X#define EDITOUT            9
  1247. X#define FORMS            10
  1248. X#define FULLNAME        11
  1249. X#define KEYPAD            12
  1250. X#define LOCALSIGNATURE        13
  1251. X#define MAILBOX            14
  1252. X#define MAILDIR            15
  1253. X#define MENU            16
  1254. X#define MOVEPAGE        17
  1255. X#define NAMES            18
  1256. X#define NOHEADER        19
  1257. X#define PAGER            20
  1258. X#define POINTNEW        21
  1259. X#define PREFIX            22
  1260. X#define PRINT            23
  1261. X#define REMOTESIGNATURE        24
  1262. X#define RESOLVE            25
  1263. X#define SAVEMAIL        26
  1264. X#define SAVENAME        27
  1265. X#define SHELL            28
  1266. X#define SIGNATURE        29
  1267. X#define SOFTKEYS        30
  1268. X#define SORTBY            31
  1269. X#define TIMEOUT            32
  1270. X#define TITLES            33
  1271. X#define USERLEVEL        34
  1272. X#define WARNINGS        35
  1273. X#define WEED            36
  1274. X#define WEEDOUT            37
  1275. X
  1276. X#define NUMBER_OF_SAVEABLE_OPTIONS    WEEDOUT+1
  1277. X
  1278. Xstruct save_info_recs { 
  1279. X    char     name[NLEN];     /* name of instruction */
  1280. X    long     offset;        /* offset into elmrc-info file */
  1281. X    } save_info[NUMBER_OF_SAVEABLE_OPTIONS] = 
  1282. X{
  1283. X { "alternatives", -1L }, { "alwaysdelete", -1L },     { "alwaysleave", -1L },
  1284. X { "arrow", -1L},         { "autocopy", -1L },          { "bounceback", -1L },
  1285. X { "calendar", -1L },       { "copy", -1L },              { "editor", -1L },
  1286. X { "editout", -1L },       { "forms", -1L },             { "fullname", -1L },
  1287. X { "keypad", -1L },       { "localsignature", -1L },    { "mailbox", -1L }, 
  1288. X { "maildir", -1L },       { "menu", -1L },         { "movepage", -1L }, 
  1289. X { "names", -1L },        { "noheader", -1L },         { "pager", -1L }, 
  1290. X { "pointnew", -1L},      { "prefix", -1L },           { "print", -1L }, 
  1291. X { "remotesignature",-1L},{ "resolve", -1L },           { "savemail", -1L }, 
  1292. X { "savename", -1L },     { "shell", -1L },             { "signature", -1L },
  1293. X { "softkeys", -1L },      { "sortby", -1L },         { "timeout", -1L },
  1294. X { "titles", -1L },       { "userlevel", -1L },     { "warnings", -1L },
  1295. X { "weed", -1L },         { "weedout", -1L }
  1296. X};
  1297. END_OF_hdrs/save_opts.h
  1298. if test 2043 -ne `wc -c <hdrs/save_opts.h`; then
  1299.     echo shar: \"hdrs/save_opts.h\" unpacked with wrong size!?
  1300. fi
  1301. # end of overwriting check
  1302. fi
  1303. if test ! -d src ; then
  1304.     echo shar: Creating directory \"src\"
  1305.     mkdir src
  1306. fi
  1307. echo shar: Extracting \"src/delete.c\" \(2451 characters\)
  1308. if test -f src/delete.c ; then 
  1309.   echo shar: Will not over-write existing file \"src/delete.c\"
  1310. else
  1311. sed "s/^X//" >src/delete.c <<'END_OF_src/delete.c'
  1312. X/**        delete.c        **/
  1313. X
  1314. X/**  Delete or undelete files: just set flag in header record! 
  1315. X     Also tags specified message(s)...
  1316. X
  1317. X     (C) Copyright 1985  Dave Taylor
  1318. X**/
  1319. X
  1320. X#include "headers.h"
  1321. X
  1322. Xdelete_msg(real_del)
  1323. Xint real_del;
  1324. X{
  1325. X    /** Delete current message.  If real-del is false, then we're
  1326. X        actually requested to toggle the state of the current
  1327. X        message... **/
  1328. X
  1329. X    if (real_del)
  1330. X      header_table[current-1].status |= DELETED;
  1331. X    else if (ison(header_table[current-1].status, DELETED))
  1332. X      clearit(header_table[current-1].status, DELETED);
  1333. X    else
  1334. X      setit(header_table[current-1].status, DELETED);
  1335. X
  1336. X    show_msg_status(current-1);
  1337. X}
  1338. X
  1339. Xundelete_msg()
  1340. X{
  1341. X    /** clear the deleted message flag **/
  1342. X
  1343. X    clearit(header_table[current-1].status, DELETED);
  1344. X
  1345. X    show_msg_status(current-1);
  1346. X}
  1347. X
  1348. Xshow_msg_status(msg)
  1349. Xint msg;
  1350. X{
  1351. X    /** show the status of the current message only.  **/
  1352. X
  1353. X    if (on_page(msg)) {
  1354. X      MoveCursor((msg % headers_per_page) + 4, 3);
  1355. X      if (msg == current && !arrow_cursor) {
  1356. X        StartBold();
  1357. X        Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
  1358. X        EndBold();
  1359. X      }
  1360. X      else
  1361. X        Writechar( ison(header_table[msg].status, DELETED)? 'D' : ' ');
  1362. X    }
  1363. X}
  1364. X
  1365. Xtag_message()
  1366. X{
  1367. X    /** Tag current message.  If already tagged, untag it. **/
  1368. X
  1369. X    if (ison(header_table[current-1].status, TAGGED))
  1370. X      clearit(header_table[current-1].status, TAGGED);
  1371. X    else
  1372. X      setit(header_table[current-1].status, TAGGED);
  1373. X
  1374. X    show_msg_tag(current-1);
  1375. X}
  1376. X
  1377. Xshow_msg_tag(msg)
  1378. Xint msg;
  1379. X{
  1380. X    /** show the tag status of the current message only.  **/
  1381. X
  1382. X    if (on_page(msg)) {
  1383. X      MoveCursor((msg % headers_per_page) + 4, 4);
  1384. X      if (msg == current && !arrow_cursor) {
  1385. X        StartBold();
  1386. X        Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
  1387. X        EndBold();
  1388. X      }
  1389. X      else
  1390. X        Writechar( ison(header_table[msg].status, TAGGED)? '+' : ' ');
  1391. X    }    
  1392. X}
  1393. X
  1394. Xshow_new_status(msg)
  1395. Xint msg;
  1396. X{
  1397. X    /** If the specified message is on this screen, show
  1398. X        the new status (could be marked for deletion now,
  1399. X        and could have tag removed...)
  1400. X    **/
  1401. X
  1402. X    if (on_page(msg)) 
  1403. X      if (msg == current && !arrow_cursor) {
  1404. X        StartBold();
  1405. X        PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
  1406. X           ison(header_table[msg].status, DELETED)? 'D' : ' ',
  1407. X           ison(header_table[msg].status, TAGGED )? '+' : ' ');
  1408. X        EndBold();
  1409. X      }
  1410. X      else
  1411. X        PutLine2((msg % headers_per_page) + 4, 3, "%c%c",
  1412. X           ison(header_table[msg].status, DELETED)? 'D' : ' ',
  1413. X           ison(header_table[msg].status, TAGGED )? '+' : ' ');
  1414. X}
  1415. END_OF_src/delete.c
  1416. if test 2451 -ne `wc -c <src/delete.c`; then
  1417.     echo shar: \"src/delete.c\" unpacked with wrong size!?
  1418. fi
  1419. # end of overwriting check
  1420. fi
  1421. echo shar: Extracting \"src/getopt.c\" \(2152 characters\)
  1422. if test -f src/getopt.c ; then 
  1423.   echo shar: Will not over-write existing file \"src/getopt.c\"
  1424. else
  1425. sed "s/^X//" >src/getopt.c <<'END_OF_src/getopt.c'
  1426. X/**            getopt.c            **/
  1427. X
  1428. X/** starting argument parsing routine... 
  1429. X
  1430. X    (C) Copyright 1986 Dave Taylor
  1431. X**/
  1432. X
  1433. X#include "defs.h"
  1434. X
  1435. X#ifndef NULL
  1436. X# define NULL        0
  1437. X#endif
  1438. X
  1439. X#define DONE        0
  1440. X#define ERROR        -1
  1441. X
  1442. Xchar *optional_arg;            /* optional argument as we go */
  1443. Xint   opt_index;            /* argnum + 1 when we leave   */
  1444. X
  1445. X/***********************
  1446. X
  1447. X   Typical usage of this routine is exemplified by;
  1448. X
  1449. X    register int c;
  1450. X
  1451. X    while ((c = get_options(argc, argv, "ad:f:")) > 0) {
  1452. X       switch (c) {
  1453. X         case 'a' : arrow_cursor++;        break;
  1454. X         case 'd' : debug = atoi(optional_arg);    break;
  1455. X         case 'f' : strcpy(infile, optional_arg); 
  1456. X                    mbox_specified = 2;  break;
  1457. X        }
  1458. X     }
  1459. X
  1460. X     if (c == ERROR) {
  1461. X       printf("Usage: %s [a] [-d level] [-f file] <names>\n\n", argv[0]);
  1462. X       exit(1);
  1463. X    }
  1464. X
  1465. X***********************/
  1466. X
  1467. Xint  _indx = 1, _argnum = 1;
  1468. X
  1469. Xint
  1470. Xget_options(argc, argv, options)
  1471. Xint argc;
  1472. Xchar *argv[], *options;
  1473. X{
  1474. X    /** Returns the character argument next, and optionally instantiates 
  1475. X        "argument" to the argument associated with the particular option 
  1476. X    **/
  1477. X    
  1478. X    char        *word, *strchr();
  1479. X
  1480. X    if (_argnum >= argc) {    /* quick check first - no arguments! */
  1481. X      opt_index = argc;
  1482. X      return(DONE);
  1483. X    }
  1484. X
  1485. X    if (_indx >= strlen(argv[_argnum]) && _indx > 1) {
  1486. X      _argnum++;
  1487. X      _indx = 1;        /* zeroeth char is '-' */
  1488. X    }
  1489. X
  1490. X    if (_argnum >= argc) {
  1491. X      opt_index = _argnum; /* no more args */
  1492. X      return(DONE);
  1493. X    }
  1494. X
  1495. X    if (argv[_argnum][0] != '-') {
  1496. X      opt_index = _argnum;
  1497. X      return(DONE);
  1498. X    }
  1499. X
  1500. X        word = strchr(options, argv[_argnum][_indx++]);
  1501. X
  1502. X    if (word == NULL)
  1503. X      return(ERROR);        /* Sun compatibility */
  1504. X
  1505. X    if (word == NULL || strlen(word) == 0) 
  1506. X      return(ERROR);
  1507. X    
  1508. X    if (word[1] == ':') {
  1509. X
  1510. X      /** Two possibilities - either tailing end of this argument or the 
  1511. X          next argument in the list **/
  1512. X
  1513. X      if (_indx < strlen(argv[_argnum])) { /* first possibility */
  1514. X        optional_arg = (char *) (argv[_argnum] + _indx);
  1515. X        _argnum++;
  1516. X        _indx = 1;
  1517. X      }
  1518. X      else {                /* second choice     */
  1519. X        if (++_argnum >= argc) 
  1520. X          return(ERROR);            /* no argument!!     */
  1521. X
  1522. X        optional_arg = (char *) argv[_argnum++];
  1523. X        _indx = 1;
  1524. X      }
  1525. X    }
  1526. X
  1527. X    return((int) word[0]);
  1528. X}
  1529. END_OF_src/getopt.c
  1530. if test 2152 -ne `wc -c <src/getopt.c`; then
  1531.     echo shar: \"src/getopt.c\" unpacked with wrong size!?
  1532. fi
  1533. # end of overwriting check
  1534. fi
  1535. echo shar: Extracting \"src/output_utils.c\" \(2034 characters\)
  1536. if test -f src/output_utils.c ; then 
  1537.   echo shar: Will not over-write existing file \"src/output_utils.c\"
  1538. else
  1539. sed "s/^X//" >src/output_utils.c <<'END_OF_src/output_utils.c'
  1540. X/**            output_utils.c            **/
  1541. X
  1542. X/** This file contains routines used for output in the ELM program.
  1543. X
  1544. X    These routines (C) Copyright 1986 Dave Taylor
  1545. X**/
  1546. X
  1547. X#include "headers.h"
  1548. X
  1549. X
  1550. Xstatic char err_buffer[SLEN];        /* store last error message */
  1551. X
  1552. Xstatic char central_message_buffer[SLEN];
  1553. X
  1554. Xchar *strcpy();
  1555. X
  1556. Xshow_last_error()
  1557. X{
  1558. X    /** rewrite last error message! **/
  1559. X
  1560. X    error(err_buffer);
  1561. X}
  1562. X
  1563. Xclear_error()
  1564. X{
  1565. X    MoveCursor(LINES,0);
  1566. X    CleartoEOLN();
  1567. X    err_buffer[0] = '\0';
  1568. X}
  1569. X
  1570. Xset_error(s)
  1571. Xchar *s;
  1572. X{
  1573. X    strcpy(err_buffer, s);
  1574. X}
  1575. X
  1576. Xerror(s)
  1577. Xchar *s;
  1578. X{
  1579. X    /** outputs error 's' to screen at line 22, centered! **/
  1580. X
  1581. X    MoveCursor(LINES,0);
  1582. X    CleartoEOLN();
  1583. X    PutLine0(LINES,(COLUMNS-strlen(s))/2,s);
  1584. X    fflush(stdout);
  1585. X    strcpy(err_buffer, s);    /* save it too! */
  1586. X}
  1587. X
  1588. X/*VARARGS1*/
  1589. X
  1590. Xerror1(s, a)
  1591. Xchar *s, *a;
  1592. X{
  1593. X    /** same as error, but with a 'printf' argument **/
  1594. X    char buffer[SLEN];
  1595. X
  1596. X    sprintf(buffer,s,a);
  1597. X    error(buffer);
  1598. X}
  1599. X
  1600. X/*VARARGS1*/
  1601. X
  1602. Xerror2(s, a1, a2)
  1603. Xchar *s, *a1, *a2;
  1604. X{
  1605. X    /** same as error, but with two 'printf' arguments **/
  1606. X    char buffer[SLEN];
  1607. X
  1608. X    sprintf(buffer,s, a1, a2);
  1609. X    error(buffer);
  1610. X}
  1611. X
  1612. X/*VARARGS1*/
  1613. X
  1614. Xerror3(s, a1, a2, a3)
  1615. Xchar *s, *a1, *a2, *a3;
  1616. X{
  1617. X    /** same as error, but with three 'printf' arguments **/
  1618. X    char buffer[SLEN];
  1619. X
  1620. X    sprintf(buffer,s, a1, a2, a3);
  1621. X    error(buffer);
  1622. X}
  1623. X
  1624. Xlower_prompt(s)
  1625. Xchar *s;
  1626. X{
  1627. X    /** prompt user for input on LINES-1 line, left justified **/
  1628. X
  1629. X    PutLine0(LINES-1,0,s);
  1630. X    CleartoEOLN();
  1631. X}
  1632. X
  1633. Xprompt(s)
  1634. Xchar *s;
  1635. X{
  1636. X    /** prompt user for input on LINES-3 line, left justified **/
  1637. X
  1638. X    PutLine0(LINES-3,0,s);
  1639. X    CleartoEOLN();
  1640. X}
  1641. X
  1642. X
  1643. Xset_central_message(string, arg)
  1644. Xchar *string, *arg;
  1645. X{
  1646. X    /** set up the given message to be displayed in the center of
  1647. X        the current window **/ 
  1648. X
  1649. X    sprintf(central_message_buffer, string, arg);
  1650. X}
  1651. X
  1652. Xdisplay_central_message()
  1653. X{
  1654. X    /** display the message if set... **/
  1655. X
  1656. X    if (central_message_buffer[0] != '\0') {
  1657. X      ClearLine(LINES-15);
  1658. X      Centerline(LINES-15, central_message_buffer);
  1659. X      fflush(stdout);
  1660. X    }
  1661. X}
  1662. X
  1663. Xclear_central_message()
  1664. X{
  1665. X    /** clear the central message buffer **/
  1666. X
  1667. X    central_message_buffer[0] = '\0';
  1668. X}
  1669. END_OF_src/output_utils.c
  1670. if test 2034 -ne `wc -c <src/output_utils.c`; then
  1671.     echo shar: \"src/output_utils.c\" unpacked with wrong size!?
  1672. fi
  1673. # end of overwriting check
  1674. fi
  1675. echo shar: Extracting \"src/pmalloc.c\" \(1249 characters\)
  1676. if test -f src/pmalloc.c ; then 
  1677.   echo shar: Will not over-write existing file \"src/pmalloc.c\"
  1678. else
  1679. sed "s/^X//" >src/pmalloc.c <<'END_OF_src/pmalloc.c'
  1680. X/**            pmalloc.c        **/
  1681. X
  1682. X/** This routine contains a cheap permanent version of the malloc call to 
  1683. X    speed up the initial allocation of the weedout headers and the uuname 
  1684. X    data.  
  1685. X
  1686. X      This routine is originally from Jim Davis of HP Labs, with some 
  1687. X    mods by me.
  1688. X**/
  1689. X
  1690. X#include <stdio.h>
  1691. X#include "defs.h"
  1692. X
  1693. X/*VARARGS0*/
  1694. X
  1695. Xchar *pmalloc(size)
  1696. Xint size; 
  1697. X{
  1698. X    /** return the address of a specified block **/
  1699. X
  1700. X    static char *our_block = NULL;
  1701. X    static int   free_mem  = 0;
  1702. X
  1703. X    char   *return_value, *malloc();
  1704. X
  1705. X    /** if bigger than our threshold, just do the real thing! **/
  1706. X
  1707. X    if (size > PMALLOC_THRESHOLD) 
  1708. X       return(malloc(size));
  1709. X
  1710. X    /** if bigger than available space, get more, tossing what's left **/
  1711. X
  1712. X    if (size > free_mem) {
  1713. X      if ((our_block = malloc(PMALLOC_BUFFER_SIZE)) == NULL) {
  1714. X        fprintf(stderr, "\n\r\n\rCouldn't malloc %d bytes!!\n\r\n\r",
  1715. X            PMALLOC_BUFFER_SIZE);
  1716. X        leave();    
  1717. X          }
  1718. X      our_block += 4;  /* just for safety, don't give back true address */
  1719. X      free_mem = PMALLOC_BUFFER_SIZE-4;
  1720. X    }
  1721. X    
  1722. X    return_value  = our_block;    /* get the memory */
  1723. X    size = ((size+3)/4)*4;        /* Go to quad byte boundary */
  1724. X    our_block += size;        /* use it up      */
  1725. X    free_mem  -= size;        /*  and decrement */
  1726. X
  1727. X    return( (char *) return_value);
  1728. X}
  1729. END_OF_src/pmalloc.c
  1730. if test 1249 -ne `wc -c <src/pmalloc.c`; then
  1731.     echo shar: \"src/pmalloc.c\" unpacked with wrong size!?
  1732. fi
  1733. # end of overwriting check
  1734. fi
  1735. echo shar: Extracting \"src/quit.c\" \(577 characters\)
  1736. if test -f src/quit.c ; then 
  1737.   echo shar: Will not over-write existing file \"src/quit.c\"
  1738. else
  1739. sed "s/^X//" >src/quit.c <<'END_OF_src/quit.c'
  1740. X/**        quit.c        **/
  1741. X
  1742. X/** quit: leave the current mailbox and quit the program.
  1743. X  
  1744. X    (C) Copyright 1985, Dave Taylor
  1745. X**/
  1746. X
  1747. X#include "headers.h"
  1748. X
  1749. Xlong bytes();
  1750. X
  1751. Xquit()
  1752. X{
  1753. X    /* a wonderfully short routine!! */
  1754. X
  1755. X    if (leave_mbox(1) == -1)
  1756. X      return;            /* new mail!  (damn it)  resync */
  1757. X
  1758. X    leave();
  1759. X}
  1760. X
  1761. Xresync()
  1762. X{
  1763. X    /** Resync on the current mailbox... This is simple: simply call
  1764. X       'newmbox' to read the file in again, set the size (to avoid
  1765. X        confusion in the main loop) and refresh the screen!
  1766. X    **/
  1767. X
  1768. X      newmbox(1, TRUE, TRUE);
  1769. X      mailfile_size = bytes(infile);    
  1770. X      showscreen();
  1771. X}
  1772. END_OF_src/quit.c
  1773. if test 577 -ne `wc -c <src/quit.c`; then
  1774.     echo shar: \"src/quit.c\" unpacked with wrong size!?
  1775. fi
  1776. # end of overwriting check
  1777. fi
  1778. echo shar: Extracting \"src/remail.c\" \(2019 characters\)
  1779. if test -f src/remail.c ; then 
  1780.   echo shar: Will not over-write existing file \"src/remail.c\"
  1781. else
  1782. sed "s/^X//" >src/remail.c <<'END_OF_src/remail.c'
  1783. X/**            remail.c            **/
  1784. X
  1785. X/** For those cases when you want to have a message continue along
  1786. X    to another person in such a way as they end up receiving it with
  1787. X    the return address the person YOU received the mail from (does
  1788. X    this comment make any sense yet??)...
  1789. X
  1790. X    (C) Copyright 1986  Dave Taylor
  1791. X**/
  1792. X
  1793. X#include "headers.h"
  1794. X#include <errno.h>
  1795. X
  1796. Xextern int errno;
  1797. X
  1798. Xchar *error_name(), *error_description();
  1799. X
  1800. Xint
  1801. Xremail()
  1802. X{
  1803. X    /** remail a message... returns TRUE if new foot needed ... **/
  1804. X    
  1805. X    FILE *mailfd;
  1806. X    char entered[VERY_LONG_STRING], expanded[VERY_LONG_STRING];
  1807. X    char filename[SLEN], buffer[VERY_LONG_STRING];
  1808. X
  1809. X    entered[0] = '\0';
  1810. X
  1811. X    get_to(entered, expanded);
  1812. X    if (strlen(entered) == 0)
  1813. X      return(0);
  1814. X
  1815. X    display_to(expanded);
  1816. X
  1817. X    /** now the munge... **/
  1818. X
  1819. X    sprintf(filename, "%s%d", temp_file, getpid());
  1820. X
  1821. X    if ((mailfd = fopen(filename, "w")) == NULL) {
  1822. X      dprint1(1,"couldn't open temp file %s! (remail)\n", filename);
  1823. X      dprint2(1,"** %s - %s **\n", error_name(errno),
  1824. X          error_description(errno));
  1825. X      sprintf(buffer, "Sorry - couldn't open file %s for writing (%s)",
  1826. X          error_name(errno));
  1827. X      set_error(buffer);
  1828. X      return(1);
  1829. X    }
  1830. X
  1831. X    /** now let's copy the message into the newly opened
  1832. X        buffer... **/
  1833. X
  1834. X    copy_message("", mailfd, FALSE, TRUE);  
  1835. X
  1836. X    fclose(mailfd);
  1837. X
  1838. X    /** Got the messsage, now let's ensure the person really wants to 
  1839. X        remail it... **/
  1840. X
  1841. X    ClearLine(LINES-1);
  1842. X    ClearLine(LINES);
  1843. X    PutLine1(LINES-1,0,
  1844. X        "Are you sure you want to remail this message (y/n) ? y%c",
  1845. X        BACKSPACE);
  1846. X    fflush(stdin);
  1847. X    fflush(stdout);
  1848. X    if (tolower(ReadCh()) == 'n') { /* another day, another No... */
  1849. X      Write_to_screen("No", 0);
  1850. X      set_error("Bounce of message cancelled");
  1851. X          return(1);
  1852. X    }
  1853. X    Write_to_screen("Yes!", 0);
  1854. X
  1855. X    sprintf(buffer, "%s %s < %s", mailer, expanded, filename);
  1856. X
  1857. X    PutLine0(LINES,0,"resending mail...");
  1858. X
  1859. X    if ((errno = system_call(buffer, SH)) != 0) {
  1860. X      sprintf(buffer, "Remail failed with error %d!", errno);
  1861. X      set_error(buffer);
  1862. X    }
  1863. X    else
  1864. X      set_error("mail resent");
  1865. X
  1866. X    return(1);
  1867. X}
  1868. END_OF_src/remail.c
  1869. if test 2019 -ne `wc -c <src/remail.c`; then
  1870.     echo shar: \"src/remail.c\" unpacked with wrong size!?
  1871. fi
  1872. # end of overwriting check
  1873. fi
  1874. echo shar: Extracting \"src/signals.c\" \(1384 characters\)
  1875. if test -f src/signals.c ; then 
  1876.   echo shar: Will not over-write existing file \"src/signals.c\"
  1877. else
  1878. sed "s/^X//" >src/signals.c <<'END_OF_src/signals.c'
  1879. X/**            signals.c        **/
  1880. X
  1881. X/** This set of routines traps various signals and informs the
  1882. X    user of the error, leaving the program in a nice, graceful
  1883. X    manner.
  1884. X
  1885. X    (C) Copyright 1986 Dave Taylor
  1886. X**/
  1887. X
  1888. X#include "headers.h"
  1889. X#include <signal.h>
  1890. X
  1891. Xextern int pipe_abort;        /* set to TRUE if receive SIGPIPE */
  1892. X
  1893. Xquit_signal()
  1894. X{
  1895. X    dprint0(2,"\n\n** Received SIGQUIT **\n\n\n\n");
  1896. X    leave();
  1897. X}
  1898. X
  1899. Xterm_signal() 
  1900. X{
  1901. X    dprint0(2,"\n\n** Received SIGTERM **\n\n\n\n");
  1902. X    leave();
  1903. X}
  1904. X
  1905. Xill_signal()
  1906. X{
  1907. X    dprint0(1,"\n\n** Received SIGILL **\n\n\n\n");
  1908. X    PutLine0(LINES, 0, "\n\nIllegal Instruction signal!\n\n");
  1909. X    emergency_exit();
  1910. X}
  1911. X
  1912. Xfpe_signal()  
  1913. X{
  1914. X    dprint0(1,"\n\n** Received SIGFPE **\n\n\n\n");
  1915. X    PutLine0(LINES, 0,"\n\nFloating Point Exception signal!\n\n");
  1916. X    emergency_exit();
  1917. X}
  1918. X
  1919. Xbus_signal()
  1920. X{
  1921. X    dprint0(1,"\n\n** Received SIGBUS **\n\n\n\n");
  1922. X    PutLine0(LINES, 0,"\n\nBus Error signal!\n\n");
  1923. X    emergency_exit();
  1924. X}
  1925. X
  1926. Xsegv_signal()
  1927. X{
  1928. X    dprint0(1,"\n\n** Received SIGSEGV **\n\n\n\n");
  1929. X    PutLine0(LINES, 0,"\n\nSegment Violation signal!\n\n");
  1930. X    emergency_exit();
  1931. X}
  1932. X
  1933. Xalarm_signal()
  1934. X{    
  1935. X    /** silently process alarm signal for timeouts... **/
  1936. X
  1937. X    int alarm_signal();
  1938. X
  1939. X    signal(SIGALRM, alarm_signal);
  1940. X}
  1941. X
  1942. Xpipe_signal()
  1943. X{
  1944. X    /** silently process pipe signal... **/
  1945. X
  1946. X    int pipe_signal();
  1947. X
  1948. X    dprint0(2,"*** received SIGPIPE ***\n\n");
  1949. X    
  1950. X    pipe_abort = TRUE;    /* internal signal ... wheeee!  */
  1951. X
  1952. X    signal(SIGPIPE, pipe_signal);
  1953. X}
  1954. END_OF_src/signals.c
  1955. if test 1384 -ne `wc -c <src/signals.c`; then
  1956.     echo shar: \"src/signals.c\" unpacked with wrong size!?
  1957. fi
  1958. # end of overwriting check
  1959. fi
  1960. echo shar: Extracting \"src/string2.c\" \(993 characters\)
  1961. if test -f src/string2.c ; then 
  1962.   echo shar: Will not over-write existing file \"src/string2.c\"
  1963. else
  1964. sed "s/^X//" >src/string2.c <<'END_OF_src/string2.c'
  1965. X/**            string2.c        **/
  1966. X
  1967. X/** This file contains string functions that are shared throughout the
  1968. X    various ELM utilities...
  1969. X
  1970. X    (C) Copyright 1986 Dave Taylor
  1971. X**/
  1972. X
  1973. X#ifndef TRUE
  1974. X#define TRUE        1
  1975. X#define FALSE        0
  1976. X#endif
  1977. X
  1978. Xint 
  1979. Xin_string(buffer, pattern)
  1980. Xchar *buffer, *pattern;
  1981. X{
  1982. X    /** Returns TRUE iff pattern occurs IN IT'S ENTIRETY in buffer. **/ 
  1983. X
  1984. X    register int i = 0, j = 0;
  1985. X    
  1986. X    while (buffer[i] != '\0') {
  1987. X      while (buffer[i++] == pattern[j++]) 
  1988. X        if (pattern[j] == '\0') 
  1989. X          return(TRUE);
  1990. X      i = i - j + 1;
  1991. X      j = 0;
  1992. X    }
  1993. X    return(FALSE);
  1994. X}
  1995. X
  1996. Xint
  1997. Xchloc(string, ch)
  1998. Xchar *string, ch;
  1999. X{
  2000. X    /** returns the index of ch in string, or -1 if not in string **/
  2001. X    register int i;
  2002. X
  2003. X    for (i=0; i<strlen(string); i++)
  2004. X      if (string[i] == ch) return(i);
  2005. X    return(-1);
  2006. X}
  2007. X
  2008. Xint
  2009. Xoccurances_of(ch, string)
  2010. Xchar ch, *string;
  2011. X{
  2012. X    /** returns the number of occurances of 'ch' in string 'string' **/
  2013. X
  2014. X    register int count = 0, i;
  2015. X
  2016. X    for (i=0; i<strlen(string); i++)
  2017. X      if (string[i] == ch) count++;
  2018. X
  2019. X    return(count);
  2020. X}
  2021. END_OF_src/string2.c
  2022. if test 993 -ne `wc -c <src/string2.c`; then
  2023.     echo shar: \"src/string2.c\" unpacked with wrong size!?
  2024. fi
  2025. # end of overwriting check
  2026. fi
  2027. echo shar: Extracting \"src/validname.c\" \(848 characters\)
  2028. if test -f src/validname.c ; then 
  2029.   echo shar: Will not over-write existing file \"src/validname.c\"
  2030. else
  2031. sed "s/^X//" >src/validname.c <<'END_OF_src/validname.c'
  2032. X/**            validname.c            **/
  2033. X
  2034. X/** This routine takes a single address, no machine hops or
  2035. X    anything, and returns 1 if it's valid and 0 if not.  The
  2036. X    algorithm it uses is the same one that uux uses, namely:
  2037. X
  2038. X    1. Is there a file '/usr/mail/%s'?  
  2039. X    2. Is there a password entry for %s?
  2040. X    
  2041. X   (C) Copyright 1986 Dave Taylor 
  2042. X**/
  2043. X
  2044. X#include "defs.h"
  2045. X
  2046. X#include <stdio.h>
  2047. X
  2048. X#ifndef NOCHECK_VALIDNAME
  2049. X#  ifdef BSD4.1
  2050. X#    include <sys/pwd.h>
  2051. X#  else
  2052. X#    include <pwd.h>
  2053. X#  endif
  2054. X#endif
  2055. X
  2056. Xint
  2057. Xvalid_name(name)
  2058. Xchar *name;
  2059. X{
  2060. X    /** does what it says above, boss! **/
  2061. X
  2062. X#ifdef NOCHECK_VALIDNAME
  2063. X
  2064. X    return(1);        /* always say it's okay! */
  2065. X
  2066. X#else
  2067. X    struct passwd *getpwname();
  2068. X    char filebuf[SLEN];
  2069. X
  2070. X    sprintf(filebuf,"%s/%s", mailhome, name);
  2071. X    
  2072. X    if (access(filebuf, ACCESS_EXISTS) == 0)
  2073. X      return(1);
  2074. X
  2075. X    if (getpwnam(name) != NULL)
  2076. X      return(1);
  2077. X
  2078. X    return(0);
  2079. X
  2080. X#endif
  2081. X
  2082. X}
  2083. END_OF_src/validname.c
  2084. if test 848 -ne `wc -c <src/validname.c`; then
  2085.     echo shar: \"src/validname.c\" unpacked with wrong size!?
  2086. fi
  2087. # end of overwriting check
  2088. fi
  2089. if test ! -d test ; then
  2090.     echo shar: Creating directory \"test\"
  2091.     mkdir test
  2092. fi
  2093. echo shar: Extracting \"test/test.empty\" \(0 character\)
  2094. if test -f test/test.empty ; then 
  2095.   echo shar: Will not over-write existing file \"test/test.empty\"
  2096. else
  2097. sed "s/^X//" >test/test.empty <<'END_OF_test/test.empty'
  2098. END_OF_test/test.empty
  2099. if test 0 -ne `wc -c <test/test.empty`; then
  2100.     echo shar: \"test/test.empty\" unpacked with wrong size!?
  2101. fi
  2102. # end of overwriting check
  2103. fi
  2104. if test ! -d utils ; then
  2105.     echo shar: Creating directory \"utils\"
  2106.     mkdir utils
  2107. fi
  2108. echo shar: Extracting \"utils/listalias.c\" \(1786 characters\)
  2109. if test -f utils/listalias.c ; then 
  2110.   echo shar: Will not over-write existing file \"utils/listalias.c\"
  2111. else
  2112. sed "s/^X//" >utils/listalias.c <<'END_OF_utils/listalias.c'
  2113. X/**            listalias.c            **/
  2114. X
  2115. X/** Program that lists all the available aliases.  This one uses the pipe 
  2116. X    command, feeding the stuff to egrep then sort, or just sort.
  2117. X
  2118. X    (C) Copyright 1986, Dave Taylor
  2119. X**/
  2120. X
  2121. X#include <stdio.h>
  2122. X#include <fcntl.h>
  2123. X
  2124. X#include "defs.h"
  2125. X
  2126. X#define alias_hash    ".alias_hash"
  2127. X#define alias_data    ".alias_data"
  2128. X
  2129. X#ifdef BSD
  2130. X  FILE *popen();
  2131. X#endif
  2132. X
  2133. Xchar *getenv();
  2134. X
  2135. Xmain(argc, argv)
  2136. Xint argc;
  2137. Xchar *argv[];
  2138. X{
  2139. X    FILE *datafile, *fd_pipe;
  2140. X    struct alias_rec hash_record;
  2141. X    int hashfile, count = 0;
  2142. X    char buffer[LONG_SLEN], fd_hash[SLEN], 
  2143. X         fd_data[SLEN], *home;
  2144. X
  2145. X    if (argc > 2) {
  2146. X      printf("Usage: listalias <optional-regular-expression>\n");
  2147. X      exit(1);
  2148. X    }
  2149. X
  2150. X    home = getenv("HOME");
  2151. X
  2152. X    sprintf(fd_hash, "%s/%s", home, alias_hash);
  2153. X    sprintf(fd_data, "%s/%s", home, alias_data);
  2154. X
  2155. X    if (argc > 1)
  2156. X      sprintf(buffer, "egrep \"%s\" | sort", argv[1]);
  2157. X    else
  2158. X      sprintf(buffer, "sort");
  2159. X
  2160. X    if ((fd_pipe = popen(buffer, "w")) == NULL) {
  2161. X      if (argc > 1) 
  2162. X        printf("cannot open pipe to egrep program for expressions!\n");
  2163. X      fd_pipe = stdout;
  2164. X    }
  2165. X
  2166. X    do {
  2167. X
  2168. X      if ((hashfile = open(fd_hash, O_RDONLY)) > 0) {
  2169. X        if ((datafile = fopen(fd_data, "r")) == NULL) {
  2170. X          fprintf("Opened %s hash file, but couldn't open data file!\n",
  2171. X               count? "system" : "user");
  2172. X          goto next_file;
  2173. X        }
  2174. X    
  2175. X        /** Otherwise let us continue... **/
  2176. X
  2177. X        while (read(hashfile, &hash_record, sizeof (hash_record)) != 0) {
  2178. X          if (strlen(hash_record.name) > 0) {
  2179. X            fseek(datafile, hash_record.byte, 0L);
  2180. X            fgets(buffer, LONG_SLEN, datafile);
  2181. X            fprintf(fd_pipe, "%-15s  %s", hash_record.name, buffer);
  2182. X          }
  2183. X        }
  2184. X      }
  2185. X
  2186. Xnext_file: strcpy(fd_hash, system_hash_file);
  2187. X       strcpy(fd_data, system_data_file);
  2188. X
  2189. X    } while (++count < 2);
  2190. X
  2191. X    pclose(fd_pipe);
  2192. X
  2193. X    exit(0);
  2194. X}
  2195. END_OF_utils/listalias.c
  2196. if test 1786 -ne `wc -c <utils/listalias.c`; then
  2197.     echo shar: \"utils/listalias.c\" unpacked with wrong size!?
  2198. fi
  2199. # end of overwriting check
  2200. fi
  2201. echo shar: Extracting \"utils/mailrc.awk\" \(930 characters\)
  2202. if test -f utils/mailrc.awk ; then 
  2203.   echo shar: Will not over-write existing file \"utils/mailrc.awk\"
  2204. else
  2205. sed "s/^X//" >utils/mailrc.awk <<'END_OF_utils/mailrc.awk'
  2206. XBEGIN { 
  2207. X    print "# MSG alias_text file, from a .mailrc file..." 
  2208. X    print ""
  2209. X      }
  2210. X
  2211. Xnext_line == 1 { 
  2212. X
  2213. X    next_line = 0;
  2214. X        group = ""
  2215. X    for (i = 1; i <= NF; i++) {
  2216. X      if (i == NF && $i == "\\") sep = ""
  2217. X      else                       sep = ", "
  2218. X    
  2219. X      if ($i == "\\") {
  2220. X        group = sprintf("%s,", group)
  2221. X        next_line = 1;
  2222. X      }
  2223. X      else if (length(group) > 0)
  2224. X        group = sprintf("%s%s%s", group, sep, $i);
  2225. X      else
  2226. X        group = $i;
  2227. X      }
  2228. X      print "\t" group
  2229. X
  2230. X    }
  2231. X
  2232. X$1 ~ /[Aa]lias|[Gg]roup/ { 
  2233. X
  2234. X    if ( NF == 3)
  2235. X      print $2 " : user alias : " $3;
  2236. X    else {
  2237. X      group = ""
  2238. X      for (i = 3; i <= NF; i++) {
  2239. X        if (i == NF && $i == "\\") sep = ""
  2240. X        else        sep = ", "
  2241. X    
  2242. X        if ($i == "\\") {
  2243. X           group = sprintf("%s,", group)
  2244. X           next_line = 1;
  2245. X        }
  2246. X        else if (length(group) > 0) 
  2247. X           group = sprintf("%s%s%s", group, sep, $i);
  2248. X        else
  2249. X           group = $i;
  2250. X        }
  2251. X        print $2 " : group alias : " group;
  2252. X      }
  2253. X     }
  2254. END_OF_utils/mailrc.awk
  2255. if test 930 -ne `wc -c <utils/mailrc.awk`; then
  2256.     echo shar: \"utils/mailrc.awk\" unpacked with wrong size!?
  2257. fi
  2258. # end of overwriting check
  2259. fi
  2260. echo shar: Extracting \"utils/trim-headers\" \(1201 characters\)
  2261. if test -f utils/trim-headers ; then 
  2262.   echo shar: Will not over-write existing file \"utils/trim-headers\"
  2263. else
  2264. sed "s/^X//" >utils/trim-headers <<'END_OF_utils/trim-headers'
  2265. X: Use /bin/sh
  2266. X
  2267. X# This shell script is designed to be used either to trim the 'junk' headers
  2268. X# out of an archived/saved mailbox file or to trim the headers off a file 
  2269. X# that is being piped to it.  The program considers the following headers
  2270. X# to be worth saving - everything else is junked.
  2271. X#
  2272. X#    From <user> <date>
  2273. X#    From: name <address>
  2274. X#    Subject:
  2275. X#    To: 
  2276. X#    Cc:
  2277. X#    Date:
  2278. X#
  2279. X# all others are ignored and trashed.
  2280. X#
  2281. X# (C) Copyright 1986, Dave Taylor
  2282. X
  2283. X# first off, let's make the 'awk' script we'll be using...
  2284. X
  2285. Xcat << 'END_OF_AWK_SCRIPT' > /tmp/awk.$$
  2286. XBEGIN { in_body = 1 }
  2287. X{    if (in_body) {
  2288. X      if ($1 == "From") in_body = 0;
  2289. X      print $0
  2290. X    }
  2291. X    else if ($1 == "From:" || $1 == "Subject:" || $1 == "To:" || \
  2292. X             $1 == "Cc:" || $1 == "Date:")
  2293. X      print $0
  2294. X    else if (length($0) == 0) {
  2295. X      in_body = 1;
  2296. X      print $0
  2297. X    }
  2298. X}
  2299. XEND_OF_AWK_SCRIPT
  2300. X
  2301. X# next let's see if we're being piped to or if we've been handed
  2302. X# either a file name or list of file names...
  2303. X
  2304. Xif [ "$1" = "" ]
  2305. Xthen
  2306. X  cat - | awk -f /tmp/awk.$$ | uniq
  2307. X  rm -f /tmp/awk.$$
  2308. Xelse
  2309. X  for filename in $*
  2310. X  do
  2311. X    echo filtering file $filename
  2312. X    cat $filename | awk -f /tmp/awk.$$ | uniq > OUTFILE
  2313. X    mv OUTFILE $filename
  2314. X  done
  2315. X  echo done
  2316. Xfi
  2317. X  
  2318. Xexit 0 
  2319. END_OF_utils/trim-headers
  2320. if test 1201 -ne `wc -c <utils/trim-headers`; then
  2321.     echo shar: \"utils/trim-headers\" unpacked with wrong size!?
  2322. fi
  2323. chmod +x utils/trim-headers
  2324. # end of overwriting check
  2325. fi
  2326. echo shar: End of archive 1 \(of 19\).
  2327. cp /dev/null ark1isdone
  2328. DONE=true
  2329. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  2330.     if test ! -f ark${I}isdone ; then
  2331.     echo shar: You still need to run archive ${I}.
  2332.     DONE=false
  2333.     fi
  2334. done
  2335. if test "$DONE" = "true" ; then
  2336.     echo You have unpacked all 19 archives.
  2337.     echo "See the Instructions file"
  2338.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2339. fi
  2340. ##  End of shell archive.
  2341. exit 0
  2342.